package engine.dojo.element;

import org.json.JSONException;
import org.json.JSONObject;

public class RoundRectListManager {
		
	public static JSONObject specializeRoundRectList(JSONObject element){
		
		JSONObject returnAttributes = null;
		JSONObject elementAttributes = null;
		
		try{
			elementAttributes = element.getJSONObject("attributes");
		
			if(elementAttributes.getString("listType").equals("data")){
					
				JSONObject attributes = new JSONObject();
				returnAttributes = new JSONObject();
				
				String idElement = element.getString("id");
				String formSource = elementAttributes.getString("formSource");
				
				attributes.put("formSource", formSource);				
				attributes.put("postCreate", "roundRectListReceiveData('"+idElement+"')");
				
				returnAttributes.put("attributes", attributes);
				
			}else{
				return elementAttributes;
			}
			
		}catch(JSONException e){
			e.printStackTrace();
		}
		
		return returnAttributes;
	}

}
